import { BasePlugin } from "./BasePlugin";
import localforage from "localforage";

export class LoaderCachePlugin extends BasePlugin {
  constructor() {
    super();
    this.name = "LoaderCache";
    this.version = "1.0.0";
    this.key = "cachePlugin";
  }

  get(name: string) {
    return localforage.getItem(`cax-base-${name}`);
  }

  set(name: string, value: any) {
    return localforage.setItem(`cax-base-${name}`, value);
  }
}
